package au.gov.bom.weather;

import java.net.URL;

/**
 * BOM Weather service
 * 
 * @author Sergiy Litsenko
 * @see http://www.bom.gov.au/catalogue/data-feeds.shtml Weather Data Services
 * @see http://www.bom.gov.au/weather/schema/v1.1/product.xsd  XSD for output data
 * @see http://www.bom.gov.au/inside/itb/dm/idcodes/tables/current/nsw_act_products.shtml  
 */
public interface BomWeatherService {
	/**
	 * FTP based service
	 */
	public static final String BOM_SERVICE_URL = "ftp://ftp2.bom.gov.au/anon/gen/fwo/";
	// Images URL
	public static final String BOM_IMAGES_URL = "http://www.bom.gov.au/images/symbols/large/";

	// XML file for Sydney metropolitan area
	public static final String CODE_SYDNEY_REGION_FORECAST = "IDN10064.xml";
	
	// some Sydney region locations
	public static final String [] SYDNEY_REGION = 
		{"Sydney","Penrith","Liverpool","Terrey Hills","Richmond","Parramatta","Campbelltown","Bondi"};  
	
	// XML file for ACT and Canberra metropolitan area
	public static final String CODE_CANBERRA_REGION_FORECAST = "IDN10035.xml";
	
	// Canberra region locations
	public static final String [] ACT_REGION = {"Canberra","Tuggeranong"};  

	/**
	 * weather graphic codes
	 */
	public static final int WGC_SUNNY = 1; 
	public static final int WGC_CLEAR = 2;
	public static final int WGC_PARTLY_CLOUDY = 3;
	public static final int WGC_CLOUDI = 4;
	public static final int WGC_HAZY = 6;
	public static final int WGC_LIGHT_RAIN = 8;
	public static final int WGC_WINDY = 9;
	public static final int WGC_FOG = 10;
	public static final int WGC_SHOWER = 11;
	public static final int WGC_RAIN = 12;
	public static final int WGC_DUSTY = 13;
	public static final int WGC_FROST = 14;
	public static final int WGC_SNOW = 15;
	public static final int WGC_STORM = 16;
	public static final int WGC_LIGHT_SHOWER = 17;
	
	/**
	 * Get forecast based on BOM supported codes
	 * @param code BOM supported codes
	 * @return forecast based on BOM supported codes
	 * @throws BomWeatherServiceException
	 * @see http://www.bom.gov.au/inside/itb/dm/idcodes/tables/current/nsw_act_products.shtml
	 */
	ProductType getForecast (String code) throws BomWeatherServiceException;

	/**
	 * Get forecast based on BOM supported codes
	 * @param code URI - the service URL and BOM supported code 
	 * @return forecast based on BOM supported codes
	 * @throws BomWeatherServiceException
	 * @see http://www.bom.gov.au/inside/itb/dm/idcodes/tables/current/nsw_act_products.shtml
	 */
	ProductType getForecast (URL codeUri) throws BomWeatherServiceException;
	
	/**
	 * Get web server URL for image by weather graphic codes
	 * @param weatherGraphicCode
	 * @return web server URL for image by weather graphic codes
	 */
	URL getImage (int weatherGraphicCode);
}
